<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:f="http://java.sun.com/jsf/core">
    <ui:composition template="layout.xhtml">
        <ui:define name="body">
            <h2>Pesquisar Correição</h2>
            <h:form id="form" acceptcharset="utf-8">
                <p:growl id="msg" life="3000" />
                <p:panel styleClass="container_24 clearfix " style="background: none; border: none;">
                    <p class="subtitle">Filtro</p>
                    <p:outputLabel value="Executor:" styleClass="grid_3"/>
                    <p:inputText value="#{managerSearcheQuestionnaireResponse.executor.name}" styleClass="grid_7"/>
                    
                    <p:outputLabel value="Cartório:" styleClass="grid_3" />
                    <p:inputText value="#{managerSearcheQuestionnaireResponse.notatyOffice.nome}" styleClass="grid_7"/>
                    
                    <div class="clear"/>
                    
                    <p:outputLabel value="Titular:" styleClass="grid_3" />
                    <p:inputText value="#{managerSearcheQuestionnaireResponse.notatyOffice.titular}" styleClass="grid_7"/>
                    
                    <div class="clear"/>
                    
                    <div class="buttonAction">
                        <p:commandButton value="Pesquisar" icon="ui-icon-search" 
                                         actionListener="#{managerSearcheQuestionnaireResponse.searchQResponse()}" 
                                         style="font-size: 12px;" styleClass="ui-priority-primary"
                                         update="@form, table"/>
                        <p:commandButton value="Cancelar" icon="ui-icon-close" actionListener="#{managerRedirect.redirect('eyre.xhtml')}" style="font-size: 12px;" update="@form"/>
                    </div>
                    
                    <div class="clear"/>
                    
                    
                    
                    <p class="subtitle">Resultado</p>
                    
                    <div class="clear"/>
                    <p:dataTable id="table" value="#{managerSearcheQuestionnaireResponse.searchQuestionnaireResponse}"
                                 var="q" emptyMessage="Nenhuma Correição"
                                 styleClass="dataTable">                       
                        <f:facet name="header">
                            <h:outputText value="Correição"/>
                        </f:facet>

                        <p:column headerText="Executor" style="font-size: 12px; width: 250px;">
                            <h:outputText value="#{q.executor.name}" style="font-size: 12px;"/>
                        </p:column>
                        <p:column headerText="Cartório" style="font-size: 12px; width: 250px;">
                            <h:outputText value="#{q.notaryOffice.nome}" style="font-size: 12px;"/>
                        </p:column>
                        <p:column headerText="Questionário" style="font-size: 12px; width: 250px;">
                            <h:outputText value="#{q.questionnaire.titulo}" style="font-size: 12px;"/>
                        </p:column>
                        <p:column headerText="Data" style="font-size: 12px; width: 100px;">
                            <h:outputText value="#{q.dateQ}" style="font-size: 12px;">
                                <f:convertDateTime pattern="dd/MM/yyyy"/>
                            </h:outputText>
                        </p:column>

                        <p:column headerText="Opções" style="font-size: 12px; width: 20px;">
                            <!--<p:commandButton icon="ui-icon-folder-collapsed" actionListener="{managerEditExecutor.redirect('editExecutor.xhtml', e)}" title="Editar" />-->
                            <p:commandButton icon="ui-icon-circle-zoomin" 
                                             action="#{managerRelDeterminations.viewDetermination(q)}"
                                             actionListener="#{managerRelQuestionnaireResponse.viewQuestionnaireResponse(q)}"
                                             update="@form"  title="Visualizar Respostas da Correição" label="Visualizar Respostas da Correição" />
                            <p:commandButton icon="ui-icon-print" actionListener="#{managerRelGeral.generetorReportPdf(q)}" update="@form" ajax="false" title="Imprimir Respostas da Correição" rendered="false" />
                            <p:commandButton icon="ui-icon-info" actionListener="#{managerRelDeterminations.viewDetermination(q)}"  title="Determinação" update="@form"  rendered="false" />
                            <p:commandButton icon="ui-icon-check" actionListener="#{managerRelConclusion.generetorReportPdf(q)}" ajax="false" title="Conclusão" update="@form" rendered="false"  />
                            <p:commandButton icon="ui-icon-comment" actionListener="#{managerRelCorreicao.generetorReportPdf(q)}" ajax="false" title="Comprovante" update="@form"  rendered="false" />

                        </p:column>
                    </p:dataTable>
                    <br/>
                </p:panel>
            </h:form>
        </ui:define>
    </ui:composition>

</html>